# How can I can change CORS policy for my account

**URL:** <https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988>\
**Category:** Developing with Prismic\
**Tags:** graphql\
**Created:** [June 25, 2020, 1:46pm UTC](https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988 "2020-06-25T13:46:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![shereen](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@shereen](https://community.prismic.io/u/shereen)\
**Post date:** [June 25, 2020, 1:46pm UTC](https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988/1 "2020-06-25T13:46:19Z")

</div>

I am using Prismic for website content serving purpose and management. Now I am trying to use for my mobile application as well. I am using apollo apollo-link library to connect to Prismic Graphql server. As a start, when I tried to from local system, i am started having this below CORS issue.

> Access to XMLHttpRequest at '[https://mahaseelarticles.prismic.io/graphql](https://mahaseelarticles.prismic.io/graphql)' from origin '[http://localhost:8103](http://localhost:8103)' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

How can I change the CORS setting for my Acc graphql server, so that I move forward ?

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [June 26, 2020, 10:15am UTC](https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988/5 "2020-06-26T10:15:44Z")

</div>

Hi Mahaseel,

Welcome to Prismic community.

In order to be able to help you on this, I need to have a look at the query you are doing, in some cases this issue can come from using long queries.

It would be great if you can share a code snippet with us.

Looking forward to your reply,  
Fares

---

<div class="post-metadata">

**Author:** ![dev2](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dev2](https://community.prismic.io/u/dev2)\
**Post date:** [July 9, 2020, 4:49pm UTC](https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988/6 "2020-07-09T16:49:24Z")

</div>

I have the same issue. Testing on localhost using graphql and a query that works interactively, I’m getting a cors error.

---

<div class="post-metadata">

**Author:** ![dev2](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@dev2](https://community.prismic.io/u/dev2)\
**Post date:** [July 9, 2020, 7:17pm UTC](https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988/7 "2020-07-09T19:17:43Z")

</div>

Following up in case others run into this, after re-reading the docs I see that Prismic only supports GET vs POST, which is the standard most libraries use. I’ve been able to get things working with the custom prismic Apollo link.

Here’s the snippet that works:

import { PrismicLink } from “apollo-link-prismic”;  
import { InMemoryCache, IntrospectionFragmentMatcher } from “apollo-cache-inmemory”;  
import ApolloClient from “apollo-client”;  
import gql from “graphql-tag”;

const client = new ApolloClient({  
link: PrismicLink({ uri: “[https://your-prismic-project.prismic.io/graphql](https://your-prismic-project.prismic.io/graphql)”, }),  
cache: new InMemoryCache({  
fragmentMatcher: new IntrospectionFragmentMatcher({ introspectionQueryResultData: { \_\_schema: { types: , }, }, })  
})  
});

async function runQuery(query, variables = null) {  
const result = await client.query({query, variables});  
if (result) return result.data;  
else return null;  
}

// call it as:  
const QUERY = gql `query Pages ($type: String) { _allDocuments (type: $type) { edges { node { _meta { id, uid, type, } } } } }`;

funQuery(QUERY, {type:“foo”}).then(data =\> {  
…  
});

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [July 10, 2020, 1:24pm UTC](https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988/8 "2020-07-10T13:24:24Z")

</div>

Hi Worthee,

Thank you for sharing this solution with Prismic community it is really appreciated.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [September 17, 2020, 4:38pm UTC](https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988/9 "2020-09-17T16:38:03Z")

</div>

closed on September 17, 2020, 4:38pm UTC, flag & select 'Something Else' to reopen.



---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:32pm UTC](https://community.prismic.io/t/how-can-i-can-change-cors-policy-for-my-account/988/10 "2021-12-09T17:32:32Z")

</div>

Opened on December 9, 2021, 5:32pm UTC


