Is it really correct that the Javascript version of the graph SDK doesn't offer typed requests?
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 42/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- javascript, typescript
- Bereich
- api, developer-experience
Rechercherichtung
Start with the JavaScript tab in the linked Microsoft Graph search-query documentation and inspect the client.api('/search/query') request and response behavior. Compare that with the typed C# sample; done means establishing whether typed request and response support exists in this SDK and documenting or scoping the gap clearly.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I'm coming from a C# background so forgive me if I'm wrong on this, but from the documentation it seems for example that doing a graph search in C# is fully typed, e.g:
var requestBody = new QueryPostRequestBody
{
Requests = new List<SearchRequest>
{
new SearchRequest
{
EntityTypes = new List<EntityType?>
{
EntityType.ExternalItem,
},
ContentSources = new List<string>
{
"/external/connections/connectionfriendlyname",
},
Region = "US",
Query = new SearchQuery
{
QueryString = "contoso product",
},
From = 0,
Size = 25,
Fields = new List<string>
{
"title",
"description",
},
},
},
};
var result = await graphClient.Search.Query.PostAsQueryPostResponseAsync(requestBody);
Which is fine, give you a SearchResponse object.
whereas in javascript you need to use the "magic string" /search/query for example:
const searchResponse = {
requests: [
{
entityTypes: [
'externalItem'
],
contentSources: [
'/external/connections/connectionfriendlyname'
],
region: 'US',
query: {
queryString: 'contoso product'
},
from: 0,
size: 25,
fields: [
'title',
'description'
]
}
]
};
await client.api('/search/query')
.post(searchResponse);
And this returns an any type, so you have to know/guess the response?
Both samples taken from https://learn.microsoft.com/en-us/graph/api/search-query?view=graph-rest-1.0&utm_source=chatgpt.com&tabs=javascript
Is this actually correct?
- Vorherrschende Sprache
- TypeScript
- Sterne
- 833
- Forks
- 240
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoftgraph/msgraph-sdk-javascript
-
status:waiting-for-triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
-
Is anyone here? Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
microsoftgraph/msgraph-sdk-javascript#2005 · 1 Reaktion ·
-
status:waiting-for-triage type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
microsoftgraph/msgraph-sdk-javascript#1999 · 2 Kommentare · 1 Reaktion ·
-
status:waiting-for-triage type:bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
Alle Issues in microsoftgraph/msgraph-sdk-javascript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
0xMiden/bridge-portal#132 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
area:tools bug good first issue help wanted priority:P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
newrelic-experimental/preflight#793 · 1 Kommentar ·